Repository navigation
fix: skip the generated package.json when the root type matches - #957
Merged
satya164 merged 3 commits intoOct 21, 2026
Merged
Conversation
Bob writes a package.json with a `type` field to output folders such as lib/module and lib/typescript. That file starts a new package scope. Node.js, TypeScript and Metro resolve the `imports` field from the closest package.json, so subpath imports used in the source fail to resolve in the built files. When the root package.json already has the same `type`, the generated file isn't needed, so skip it. Also warn when the file is generated and the root package.json has an `imports` field.
satya164
enabled auto-merge
October 21, 2026 14:34
markharding
pushed a commit
to futo-org/Harbor
that referenced
this pull request
Oct 27, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [react-native-builder-bob](https://oss.callstack.com/react-native-builder-bob/build) ([source](https://github.com/callstack/react-native-builder-bob/tree/HEAD/packages/react-native-builder-bob)) | [`^0.43.0` → `^0.44.0`](https://renovatebot.com/diffs/npm/react-native-builder-bob/0.43.0/0.44.1) |  |  | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information. --- ### Release Notes <details> <summary>callstack/react-native-builder-bob (react-native-builder-bob)</summary> ### [`v0.44.1`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0441-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.44.0...react-native-builder-bob@0.44.1) ##### Bug Fixes - add fixes for expo and ssr in bite config ([e2db44f](callstack/react-native-builder-bob@e2db44f)) - by @​ ### [`v0.44.0`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0440-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.2...react-native-builder-bob@0.44.0) ##### Bug Fixes - skip the generated package.json when the root type matches ([#​957](callstack/react-native-builder-bob#957)) ([7d120d2](callstack/react-native-builder-bob@7d120d2)) - by [@​mrousavy](https://github.com/mrousavy) ##### Features - update tools in templates ([#​962](callstack/react-native-builder-bob#962)) ([2a8f2f7](callstack/react-native-builder-bob@2a8f2f7)) - by [@​satya164](https://github.com/satya164) #### [0.43.2](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) (2026-10-12) ##### Bug Fixes - copy typescript declaration files as is when compiling ([aecdcdf](callstack/react-native-builder-bob@aecdcdf)) - by [@​satya164](https://github.com/satya164) #### [0.43.1](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) (2026-09-08) ##### Bug Fixes - fix bob init producing incorrect paths on windows ([#​954](callstack/react-native-builder-bob#954)) ([e7b11ca](callstack/react-native-builder-bob@e7b11ca)) - by [@​satya164](https://github.com/satya164) - gracefully handle expo calling babel config without a filename ([ca7bdc0](callstack/react-native-builder-bob@ca7bdc0)) - by [@​satya164](https://github.com/satya164) ### [`v0.43.2`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0440-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) ##### Bug Fixes - skip the generated package.json when the root type matches ([#​957](callstack/react-native-builder-bob#957)) ([7d120d2](callstack/react-native-builder-bob@7d120d2)) - by [@​mrousavy](https://github.com/mrousavy) ##### Features - update tools in templates ([#​962](callstack/react-native-builder-bob#962)) ([2a8f2f7](callstack/react-native-builder-bob@2a8f2f7)) - by [@​satya164](https://github.com/satya164) #### [0.43.2](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) (2026-10-12) ##### Bug Fixes - copy typescript declaration files as is when compiling ([aecdcdf](callstack/react-native-builder-bob@aecdcdf)) - by [@​satya164](https://github.com/satya164) #### [0.43.1](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) (2026-09-08) ##### Bug Fixes - fix bob init producing incorrect paths on windows ([#​954](callstack/react-native-builder-bob#954)) ([e7b11ca](callstack/react-native-builder-bob@e7b11ca)) - by [@​satya164](https://github.com/satya164) - gracefully handle expo calling babel config without a filename ([ca7bdc0](callstack/react-native-builder-bob@ca7bdc0)) - by [@​satya164](https://github.com/satya164) ### [`v0.43.1`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0440-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) ##### Bug Fixes - skip the generated package.json when the root type matches ([#​957](callstack/react-native-builder-bob#957)) ([7d120d2](callstack/react-native-builder-bob@7d120d2)) - by [@​mrousavy](https://github.com/mrousavy) ##### Features - update tools in templates ([#​962](callstack/react-native-builder-bob#962)) ([2a8f2f7](callstack/react-native-builder-bob@2a8f2f7)) - by [@​satya164](https://github.com/satya164) #### [0.43.2](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) (2026-10-12) ##### Bug Fixes - copy typescript declaration files as is when compiling ([aecdcdf](callstack/react-native-builder-bob@aecdcdf)) - by [@​satya164](https://github.com/satya164) #### [0.43.1](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) (2026-09-08) ##### Bug Fixes - fix bob init producing incorrect paths on windows ([#​954](callstack/react-native-builder-bob#954)) ([e7b11ca](callstack/react-native-builder-bob@e7b11ca)) - by [@​satya164](https://github.com/satya164) - gracefully handle expo calling babel config without a filename ([ca7bdc0](callstack/react-native-builder-bob@ca7bdc0)) - by [@​satya164](https://github.com/satya164) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on tuesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2045
markharding
pushed a commit
to futo-org/Harbor
that referenced
this pull request
Oct 29, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [react-native-builder-bob](https://oss.callstack.com/react-native-builder-bob/build) ([source](https://github.com/callstack/react-native-builder-bob/tree/HEAD/packages/react-native-builder-bob)) | [`^0.43.0` → `^0.44.0`](https://renovatebot.com/diffs/npm/react-native-builder-bob/0.43.0/0.44.1) |  |  | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information. --- ### Release Notes <details> <summary>callstack/react-native-builder-bob (react-native-builder-bob)</summary> ### [`v0.44.1`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0441-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.44.0...react-native-builder-bob@0.44.1) ##### Bug Fixes - add fixes for expo and ssr in bite config ([e2db44f](callstack/react-native-builder-bob@e2db44f)) - by @​ ### [`v0.44.0`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0440-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.2...react-native-builder-bob@0.44.0) ##### Bug Fixes - skip the generated package.json when the root type matches ([#​957](callstack/react-native-builder-bob#957)) ([7d120d2](callstack/react-native-builder-bob@7d120d2)) - by [@​mrousavy](https://github.com/mrousavy) ##### Features - update tools in templates ([#​962](callstack/react-native-builder-bob#962)) ([2a8f2f7](callstack/react-native-builder-bob@2a8f2f7)) - by [@​satya164](https://github.com/satya164) #### [0.43.2](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) (2026-10-12) ##### Bug Fixes - copy typescript declaration files as is when compiling ([aecdcdf](callstack/react-native-builder-bob@aecdcdf)) - by [@​satya164](https://github.com/satya164) #### [0.43.1](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) (2026-09-08) ##### Bug Fixes - fix bob init producing incorrect paths on windows ([#​954](callstack/react-native-builder-bob#954)) ([e7b11ca](callstack/react-native-builder-bob@e7b11ca)) - by [@​satya164](https://github.com/satya164) - gracefully handle expo calling babel config without a filename ([ca7bdc0](callstack/react-native-builder-bob@ca7bdc0)) - by [@​satya164](https://github.com/satya164) ### [`v0.43.2`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0440-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) ##### Bug Fixes - skip the generated package.json when the root type matches ([#​957](callstack/react-native-builder-bob#957)) ([7d120d2](callstack/react-native-builder-bob@7d120d2)) - by [@​mrousavy](https://github.com/mrousavy) ##### Features - update tools in templates ([#​962](callstack/react-native-builder-bob#962)) ([2a8f2f7](callstack/react-native-builder-bob@2a8f2f7)) - by [@​satya164](https://github.com/satya164) #### [0.43.2](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) (2026-10-12) ##### Bug Fixes - copy typescript declaration files as is when compiling ([aecdcdf](callstack/react-native-builder-bob@aecdcdf)) - by [@​satya164](https://github.com/satya164) #### [0.43.1](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) (2026-09-08) ##### Bug Fixes - fix bob init producing incorrect paths on windows ([#​954](callstack/react-native-builder-bob#954)) ([e7b11ca](callstack/react-native-builder-bob@e7b11ca)) - by [@​satya164](https://github.com/satya164) - gracefully handle expo calling babel config without a filename ([ca7bdc0](callstack/react-native-builder-bob@ca7bdc0)) - by [@​satya164](https://github.com/satya164) ### [`v0.43.1`](https://github.com/callstack/react-native-builder-bob/blob/HEAD/packages/react-native-builder-bob/CHANGELOG.md#0440-2026-10-22) [Compare Source](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) ##### Bug Fixes - skip the generated package.json when the root type matches ([#​957](callstack/react-native-builder-bob#957)) ([7d120d2](callstack/react-native-builder-bob@7d120d2)) - by [@​mrousavy](https://github.com/mrousavy) ##### Features - update tools in templates ([#​962](callstack/react-native-builder-bob#962)) ([2a8f2f7](callstack/react-native-builder-bob@2a8f2f7)) - by [@​satya164](https://github.com/satya164) #### [0.43.2](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.1...react-native-builder-bob@0.43.2) (2026-10-12) ##### Bug Fixes - copy typescript declaration files as is when compiling ([aecdcdf](callstack/react-native-builder-bob@aecdcdf)) - by [@​satya164](https://github.com/satya164) #### [0.43.1](https://github.com/callstack/react-native-builder-bob/compare/react-native-builder-bob@0.43.0...react-native-builder-bob@0.43.1) (2026-09-08) ##### Bug Fixes - fix bob init producing incorrect paths on windows ([#​954](callstack/react-native-builder-bob#954)) ([e7b11ca](callstack/react-native-builder-bob@e7b11ca)) - by [@​satya164](https://github.com/satya164) - gracefully handle expo calling babel config without a filename ([ca7bdc0](callstack/react-native-builder-bob@ca7bdc0)) - by [@​satya164](https://github.com/satya164) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on tuesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2045
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With
esm: true, Bob writes{"type": "module"}tolib/module/package.jsonandlib/typescript/package.json, and{"type": "commonjs"}for CommonJS output. Node.js, TypeScript and Metro read theimportsfield from the closest package.json, so a library that uses subpath imports breaks after it's built:ERR_PACKAGE_IMPORT_NOT_DEFINED: Package import specifier "#internal/helper" is not defined in package .../lib/module/package.jsonTS2307: Cannot find module '#internal/helper' or its corresponding type declarations.The path for #internal/helper could not be resolved.Setting
"type": "module"in the root package.json doesn't help today because Bob writes the file anyway. With this change, Bob skips it when the roottypehas the same value and the output folder is inside the project, since the built files already get that module type from the root. If Bob still has to write the file and the root package.json has a non-emptyimportsfield, it prints a warning.Copying
importsinto the generated file isn't a general fix: targets outside the output folder would need../, which Node.js, TypeScript and Metro all reject.Libraries without a root
type(the create-react-native-library default) get the same output as before. For libraries that set it, other root fields such assideEffectsnow apply to the built files too, as they already do withesm: false. In a dual package setup the CommonJS build still gets its package.json, so subpath imports only work in the ESM build. The ESM docs have a new section about this.Test plan
yarn lint,yarn typecheckandyarn testpass. There are new tests for the helper (including an emptyimportsfield and an output folder outside the project), plus 2 tests intypescript.test.tsthat fail without this change.mainand from this branch: ESM-only, dual, CommonJS-only,esm: falseand legacy targets, with the roottypeunset,moduleorcommonjs, with and withoutimports. The only output difference is the missing package.json where the roottypematches.importsbehave the same as onmain. With"type": "module"andimports, every check passes, including a.cjstarget outsidelib.